<?php
namespace app\admin\model;

use think\Model;
use app\middleware\JWT;

class Proplan extends Model
{
    protected $schema = [
        'id' => 'int',
        'proaccount_id' => 'int',
        'name' => 'string',
        'domain' =>'string',
        'pro_time' => 'string',
        'token' => 'string',
        'switch' => 'int',
        'description' => 'string',
        'blacklist_province' => 'string',
        'blacklist_country' => 'string',
        'blacklist_city' => 'string',
        'blacklist_ip' => 'string',
        'start_time' => 'datetime',
        'end_time' => 'datetime',
    ];

    public function setTokenAttr($value) {

    }

    public function pages()
    {
        return $this->hasMany(Page::class,'proplan_id');
    }

    public function procount()
    {
        return $this->belongsTo(Proaccount::class);
    }
}
